import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '路由ID',
    key: 'routeId',
  },
  {
    title: 'uri路径',
    key: 'uri',
  },
  {
    title: '排序',
    key: 'orders',
  },
  {
    title: '状态',
    key: 'status',
    render(row) {
      return h(
        NTag,
        {
          type: row.status === 'Y' ? 'success' : 'error',
        },
        {
          default: () => (row.status === 'Y' ? '有效' : '无效'),
        }
      );
    },
  },
  {
    title: '判定器',
    key: 'predicates',
  },
  {
    title: '过滤器',
    key: 'filters',
  },
  {
    title: '描述',
    key: 'description',
  },
];
